package com.karina.visualization.chart.model;

import java.util.ArrayList;
import java.util.List;

public abstract class ChartModel<DataType> extends ShapeModel<List<DataType>> {

	public static interface DataDescriptor<DataType> {

		String getDescription(DataType item);

		String getLabel(DataType item);

		List<SeriesModel> createSeries(List<DataType> item);
	}

	protected DataDescriptor<DataType> seriesDescriptor;

	protected List<SeriesModel> serieses = new ArrayList<SeriesModel>();

	public void setDataDescriptor(DataDescriptor<DataType> descriptor) {
		seriesDescriptor = descriptor;
	}

	public void setSeies(List<SeriesModel> serieses) {
		this.serieses = serieses;
	}

	public List<SeriesModel> getSerieses() {
		return serieses;
	}

	@Override
	public void setValue(List<DataType> object) {
		super.setValue(object);

	}

	abstract public void caculatSeries();
}
